#include "BlazeEngineScriptSystem.h"

BeScriptSystem::BeScriptSystem() :
	m_pLua(NULL)
{

}

BeScriptSystem::~BeScriptSystem()
{

}

bool BeScriptSystem::Install()
{
	m_pLua = luaL_newstate();

	if (m_pLua == NULL)
		return false;

	luaL_openlibs(m_pLua);

	return true;
}

void BeScriptSystem::Uninstall()
{

}

int BeScriptSystem::DoBuffer(const char* pcBuffer)
{
	return luaL_loadbuffer(m_pLua, pcBuffer, strlen(pcBuffer), pcBuffer) || lua_pcall(m_pLua, 0, 0, 0);
}
